<script setup>
import { onMounted } from 'vue'
import Layout from './views/Layout/Layout.vue'

const handleVisibilityChange = () => {
  if (document.visibilityState === 'visible') {
    // console.log('用户回到页面，刷新数据')
    // 比如你可以重新发起请求
    location.reload()
  }
}

onMounted(() => {
  document.addEventListener('visibilitychange', handleVisibilityChange)
})
</script>

<template>
  <Layout />
</template>

<style scoped></style>
